<div class="container">
    <div class="jumbotron jumbotron-ad hidden-print">

        <h1><i class="fa fa-crosshairs"></i>&nbsp; Bugs Patterns</h1>

        <p>The complete list of descriptions given when FindBugs identify potential weaknesses.</p>

    </div>
</div>

<div class="container">



    <div class="row">
        <div class="col-md-11" id="mainCol">


            <h2>Table of Contents</h2>

            <p>
                <a class="btn btn-primary" data-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
                    Display / Hide
                </a>
            </p>
            <div class="collapse" id="collapseExample">
                <div class="card card-block">

                    <ul>
                        <% bugPatterns.each { b->
                        print """
                        <li><a href="#${b.type}">
                            ${b.title} (${b.type})
                        </a></li>
                        """
                        }
                        %>
                    </ul>
                </div>
            </div>

    <%



    bugPatterns.each {b->

            new_description = b.description
            new_description = new_description.replace("<pre>\n","<pre>");
            new_description = new_description.replace("<pre>","<pre class='keep-initial-line-feed'><code class='code.language-java keep-initial-line-feed'>")
            new_description = new_description.replace("</pre>","</code></pre>")
    print """
    <section>
        <a class="anchor" name="${b.type}"></a>
        <h2 class="page-header">
            ${b.title}
            <a href="#${b.type}" title="Permanent link"><small><i class="fa fa-link"></i></small></a>
        </h2>
        <p class="text-muted"><em><small>Bug Pattern: <tt>${b.type}</tt></small></em></p>

        ${new_description}

        <hr/>
        <br/>
    </section>
    """
    }
%>
        </div>

        <div class="col-md-1" id="rightCol">

            <div  id="sidebar_lang">
                <h4>Languages:</h4>
                <ul class="nav nav-pills nav-stacked">
                    <% if(lang == 'en') {
                        print """<li class="active"><a href="#">English</a></li>"""
                    }else {
                        print """<li><a href="bugs.htm">English</a></li>"""
                    }
                    %>
                    <% if(lang == 'ja') {
                        print """<li class="active"><a href="#">Japanese</a></li>"""
                    }else {
                        print """<li><a href="bugs_ja.htm">Japanese</a></li>"""
                    }
                    %>
                </ul>
            </div>
        </div>
    </div>
</div>

